package com.ynwa.rpc.simple;

import java.net.InetSocketAddress;

/**
 * @author gzd
 * @date 2017/12/25 17:09
 * @desc rpc 测试代码
 */
public class RpcTest {

    public static void main(String[] args) {
        new Thread(() -> {
            try {
                RpcExporter.exporter("localhost", 8088);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }).start();

        RpcImporter<EchoService> importer = new RpcImporter<>();
        EchoService echo = importer.importer(EchoServiceImpl.class, new InetSocketAddress("localhost", 8088));

        System.out.println(echo.echo("tom"));
    }
}
